#include "t_time.h"

#if defined(T_LINUX)
#include <sys/time.h>
#elif defined(T_WINDOWS)
#include <sys/timeb.h>
#endif

int64 t_get_timestamp()
{
    int64 ts = -1;
    
#if defined(T_LINUX)
    struct timeval tv;
    gettimeofday(&tv, null);
    ts = tv.tv_sec * 1000 + tv.tv_usec / 1000;
#elif defiend(T_LINUX)
    struct timeb tp;
    ftime(&tp);
    ts = tp.time;
    ts = ts *1000 + tp.millitm;
#endif

    return ts;
}